/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package imagene.jsf.org;

import java.io.InputStream;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.ViewScoped;
import org.primefaces.model.DefaultStreamedContent;
import org.primefaces.model.StreamedContent;

/**
 *
 * @author KeNaN
 */
@ManagedBean
@ViewScoped
public class imagen {
 
    private StreamedContent image;
    
    public imagen() {
    InputStream stream = this.getClass().getResourceAsStream("ima.JPG"); 
    image = new DefaultStreamedContent(stream, "image/jpeg");
    }
    public void DynamicImageController() { 
   InputStream stream = this.getClass().getResourceAsStream("ima.JPG"); 
    image = new DefaultStreamedContent(stream, "image/jpeg");
          }

       public StreamedContent getImage() {
             return this.image;
                }

}
